<table id="treegrid_${action_id}"></table>
<script type="text/javascript">

$(function() {
	$('#treegrid_${action_id}').treegrid({   
		url:'${request.contextPath}${namespace?default('')}/mp/product/classify-datagrid.json',
		rownumbers: true,
		fitColumns:true,
		collapsible:true,
		queryParams:{id:'${id?default('')}'},
		idField: 'id',
		treeField:'text',  
		frozenColumns:[[
			            {title:'${action.getDatagridTitle('name')}',field:'text',width:300},
		    		]],
		columns:[[
            {title:'${action.getDatagridTitle('id')}',field:'id',width:100},
            {title:'${action.getDatagridTitle('icon')}',field:'iconCls',width:100,formatter:function(val,rec){
            	if(val){
					return '<img style="width:64px;height:64px;" src="${downloadUrl?default('')}'+val+'?_v=${timeMillis}" />';
				}else{
					return '';
				}
            }},
            {title:'${action.getDatagridTitle('order')}',field:'order',width:100}
		]],
		onDblClickRow:function(idx,data){if(typeof onDblClickRow_${action_id} != 'undefined'){onDblClickRow_${action_id}(idx,data)}},
		onClickRow:function(idx,data){if(typeof onClickRow_${action_id} != 'undefined'){onClickRow_${action_id}(idx,data)}},
		onContextMenu:function(e,row){if(typeof onRowContextMenu_${action_id} != 'undefined'){$(this).treegrid('select', row.id);onRowContextMenu_${action_id}(e,row.id,row)}}
	});  


});

</script>
